# -*- coding : utf-8 -*-


import os
import sys

REDIS_NODES = [{'host': 'dm-8vbhbqm1mjard4hw4epd.redis.zhangbei.rds.aliyuncs.com', 'port': 6379},
               ]

FEEDBACK_REDIS_NODES = [{'host': 'dm-8vbhbqm1mjard4hw4epd.redis.zhangbei.rds.aliyuncs.com', 'port': 6379},
                        ]

# REDIS_PWD='foobared'
REDIS_PWD = 'Lingxird12345!@#'

'''
# redis集群ip和端口
REDIS_NODES = [{'host': '8.142.85.77', 'port': 8111},
               {'host': '8.142.85.77', 'port': 8112},
               {'host': '8.142.85.77', 'port': 8110},
               {'host': '8.142.85.77', 'port': 8113},
               {'host': '8.142.85.77', 'port': 8114},
               {'host': '8.142.85.77', 'port': 8115}
               ]

REDIS_PWD = 'foobared'  # redis密码
'''

# encoding:utf-8
"""
settings for accuracy
"""

ONLINE = False
cur_path = os.path.dirname(os.path.realpath(__file__))
if sys.platform.startswith('linux') and os.environ['USER'] != 'azzbcc':
    ONLINE = True
# env_str = os.getenv('ENV', 'local')
# if 'prod' == env_str:
#     ONLINE = True

# ES配置
ES_HOST = "es-cn-zvp2s533q0018r120.public.elasticsearch.aliyuncs.com"  # ES服务ip
ES_PORT = 9200  # ES服务端口
ES_URL = "http://%s:%s" % (ES_HOST, ES_PORT)
ES_USER = "elastic"
ES_PASSWORD = "Moxi123#"
USER_SESSION_INDEX = 'usersessions_cs'
CONVERSATION_HISTORY_INDEX = 'dialogues_cs'
QW_CONVERSATION_HISTORY_INDEX = 'dialogues_qw'
QW_CONVERSATION_INDEX = 'conversation_qw'

if ONLINE:
    ES_HOST = "es-cn-zvp2s533q0018r120.elasticsearch.aliyuncs.com"
    USER_SESSION_INDEX = 'usersessions'
    CONVERSATION_HISTORY_INDEX = 'dialogues'
    PLANNER_QW_CONVERSATION_HISTORY_INDEX = 'qw_dialogues'


# 数据库配置
class DBConfig(object):
    HOST = "xixin-planner.rwlb.zhangbei.rds.aliyuncs.com"
    PORT = 3306
    USERNAME = "xixin_planner"
    PASSWORD = "Lingxi@123"
    DBNAME = "ql_work_wechat"
    if ONLINE:
        HOST = "lingxiai.rwlb.zhangbei.rds.aliyuncs.com"
        PORT = 3306
        USERNAME = "sale"
        PASSWORD = "LingXi2021@)@!"
        DBNAME = "ql_work_wechat"


# redis配置
redis_host = 'r-8vbnsodfnru3u87y3ppd.redis.zhangbei.rds.aliyuncs.com'
redis_port = 6379
redis_db = 3
redis_pwd = 'Lingxird12345!@#'  # redis密码

if ONLINE:
    redis_host = 'dm-8vbhbqm1mjard4hw4epd.redis.zhangbei.rds.aliyuncs.com'
    redis_db = 3
    redis_pwd = 'Lingxird12345!@#'  # redis密码

# 火山tos
tos_ak = "AKLTNzZmYWZhNDJhMjVlNDg0ODk4YjI3OTY5MzYyZTM1ZTM"
tos_sk = "T0RSbE1tRXdZams0WVRnNE5HRTJaVGs0WWpRNU5tTmpPVGxtTkdObU5qaw=="
tos_endpoint = "tos-cn-beijing.volces.com"
tos_region = "beijing"
tos_bucket_name = "planner"
tos_base_url = "http://planner.tos-cn-beijing.volces.com/"

if ONLINE:
    tos_endpoint = "tos-cn-beijing.ivolces.com"

# 小程序配置
WX_APPID = "wx2297849d6bf5fa02"
WX_SECRET = "eda89ddb8339605761a0feac85502dcf"

# 企微配置
WE_WORK_APP_KEY = "co1a6d3d26a7b947b9"
WE_WORK_APP_SECRET = "fzxDYDGVZW1DGY1mOIDzpUCNXlBWGyrtHlpdeGM7UMDpmVZXPCER"
WE_WORK_CALLBACK_TOKEN = "zjJVJTIbdlwVMmmgmmjdrijjp4l6fZqS"
WE_WORK_ENCODING_AES_KEY = "I6cSqfRDA7v8a4hGxbHipHZJ0HI353rx"
if ONLINE:
    # 企微配置
    WE_WORK_APP_KEY = "co6975f0027e9444fb"
    WE_WORK_APP_SECRET = "tivyA0MlOARoDyJUFN2UeSWEFLkzfVPCbpBtoyVhePbwzUBn42lG"
    WE_WORK_CALLBACK_TOKEN = "ekS3fV6UR6ZJ8DYmKKEFqPY9QP5FxGOO"
    WE_WORK_ENCODING_AES_KEY = "iUEjcF7FgZbHQXbyR1ng5A4P5yYBGw0Q"
